/**
 * Copyright (C) 2011 The Android Open Source Project 
 * Emial : guoyil199@163.com
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0 
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 */ 
package com.example.app.activity;

import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;
import android.widget.Button;
import android.widget.TextView;

import com.BaseActivity;
import com.example.app.R;


/**
 * @author Administrator
 * @Email guoyil199@163.com
 * @version V1.0
 * @Date 2015��7��3�� ����4:24:44
 * @Title <B>todo</B>
 * @Description <pre>todo</pre>
 */

public class IconFontAct extends BaseActivity {

	TextView textview;
	Button btn;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_iconfont_view);
        
        Typeface iconfont = Typeface.createFromAsset(getAssets(), "iconfont/iconfont.ttf");
        textview = (TextView)findViewById(R.id.like);
        textview.setTypeface(iconfont);
        textview.setTextSize(40);
        
        TextView like1=(TextView)findViewById(R.id.like1);
        like1.setTypeface(iconfont);
        like1.setTextSize(40);
    
        btn=(Button)findViewById(R.id.btn);
        btn.setTypeface(iconfont);
        scale();
        btn.setOnClickListener(new OnClickListener() {
     			@Override
     			public void onClick(View v) {
     				/*Animation scaleSmallAnimation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.anim_scale_big);
     				textview.setAnimation(scaleSmallAnimation);
     				Toast.makeText(MainActivity.this, "onClick", Toast.LENGTH_LONG).show();*/
     				btn.setVisibility(View.GONE);
     				scale();
     			}
     		});
        
        TextView iconContent=(TextView) findViewById(R.id.tvContent);
        Typeface t=Typeface.createFromAsset(getAssets(), "iconfont2/iconfont.ttf");
        iconContent.setTypeface(t);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
    
    public void scale(){
    	AnimationSet animSet=new AnimationSet(true);
		ScaleAnimation scaleAnim = new ScaleAnimation(0, 0.1f, 0, 0.1f,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
				0.5f);
		 scaleAnim.setDuration(1000);
		 animSet.addAnimation(scaleAnim);
		 findViewById(R.id.btn).setAnimation(animSet);
		 btn.setVisibility(View.VISIBLE);
    }
}
